function setCookie(ck_key,ck_value,exdays){
    var d = new Date();
    d.setTime(d.getTime()+(exdays*24*60*60*1000));
    var expires = "expires="+d.toGMTString();
    document.cookie = ck_key+"="+ck_value+"; "+expires+"; path=/";
}
function getCookie(ck_key){
    var name = ck_key + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++) {
        var c = ca[i].trim();
        if (c.indexOf(name)==0) { return c.substring(name.length,c.length); }
    }
    return "";
}

function jump2page(target_url){
    window.location.href = target_url;
}

function jump2page_with_token(target_url){
    var templateRef = target_url;
    setCookie("templateRef", templateRef, 1); 
    window.location.href = target_url;
}

function sleep_mS(n) { //n表示的毫秒数
    var start = new Date().getTime();
    while (true) if (new Date().getTime() - start > n) break;
}